<template>
  <div>
    <h1>App...</h1>
    <p>App {{ num }}</p>
    <A :num="num" :setNum="setNum"/>
  </div>
</template>

<script>
import A from "./AComp.vue";

export default {
  name: "App",
  data() {
    return {
      num: 0,
    };
  },
  methods: {
    // 数据源在哪，更新数据的方法就在哪
    setNum() {
      this.num++;
    },
  },
  components: {
    A,
  },
};
</script>

<style></style>
